﻿using System.IO;
using System.Collections.Generic;

namespace AI3SaveEditor.AI3Files
{
    public class Js3cmiFile : GirlProfile
    {
        Js3csiFile js3csiFile;

        private readonly IDictionary<GirlProfileProperties, int> positions = new Dictionary<GirlProfileProperties, int>() {
            {GirlProfileProperties.FirstName,328},
            {GirlProfileProperties.LastName,264},
            {GirlProfileProperties.Personality,404},
            {GirlProfileProperties.EyebrowColor_R,134},
            {GirlProfileProperties.EyebrowColor_G,136},
            {GirlProfileProperties.EyebrowColor_B,138},
        };

        public Js3cmiFile(string fileName)
            : base(fileName) {
            this.js3csiFile = new Js3csiFile(PathHelper.Combine(Path.GetDirectoryName(file.FullName),
                Path.GetFileNameWithoutExtension(file.FullName), Path.GetFileNameWithoutExtension(file.FullName) + ".js3csi"));
            Load();
        }

        public override void Load() {
            base.Load();
        }

        public override void Save() {
            base.Save();
            js3csiFile.Save();
        }


        public override string LastName {
            get {
                return base.LastName;
            }
            set {
                base.LastName = value;
                js3csiFile.LastName = value;
            }
        }


        public override string FirstName {
            get {
                return base.FirstName;
            }
            set {
                base.FirstName = value;
                js3csiFile.FirstName = value;
            }
        }

        public override PersonalityType Personality {
            get {
                return base.Personality;
            }
            set {
                base.Personality = value;
                js3csiFile.Personality = value;
            }
        }

        public override System.Drawing.Color EyebrowColor {
            get {
                return base.EyebrowColor;
            }
            set {
                base.EyebrowColor = value;
                js3csiFile.EyebrowColor = value;
            }
        }

        internal override IDictionary<GirlProfileProperties, int> Postions {
            get { return positions; }
        }
    }

    public enum PersonalityType : int
    {
        C_Type = 0,
        K_Type = 1,
        T_Type = 2,
        V_Type = 3,
        U_Type = 4,
        N_Type = 5,
        P_Type = 6,
        J_Type = 7,
        Y_Type = 8,
        M_Type = 22,
        S_Type = 23,
    }
}
